﻿@{
    ViewBag.Title = "View Information";
}

<h2>View Information</h2>

@{
    if (ViewBag.Infor != null)
    {
    <div>
        <fieldset>
            <legend>@ViewBag.Infor.Username's Information</legend>
            @{
                if (ViewBag.Infor.Avatar == false)
                {
                    <p>
                        <img src="@Url.Action("GetDefaultAvatar")" alt="" />
                    </p>
                }
                else
                {
                    <p>
                        <img src="@Url.Action("GetDefaultAvatar("+ @ViewBag.Infor.Username +")")" alt="" />
                    </p>
                }
                if (ViewBag.Infor.AboutMe != null)
                {
                    <p>About Me: @ViewBag.Infor.AboutMe</p>
                }
                if (ViewBag.Infor.RealName != null)
                {
                    <p>RealName: @ViewBag.Infor.RealName</p>
                }
                if (ViewBag.Infor.Gender != null)
                {
                    if (ViewBag.Infor.Gender == true)
                    {
                        <p>Gender: Male</p>
                    }
                    else
                    {
                        <p>Gender: Female</p>
                    }
                }
            }
            <p>Email: @ViewBag.Infor.Email</p>
            @{
                 if (ViewBag.Infor.Birthday != ViewBag.Infor.CreateTime)
                 {
                    <p>Birthday: @ViewBag.Infor.Birthday</p>
                 }
                 if (ViewBag.Infor.Phone != null)
                 {
                     <p>Phone number: @ViewBag.Infor.Phone</p>
                 }
                 if (ViewBag.Infor.HomePage != null)
                 {
                     <p>Phone number: @ViewBag.Infor.HomePage</p>
                 }
                 if (ViewBag.Infor.Location != null)
                 {
                     <p>Phone number: @ViewBag.Infor.Location</p>
                 }
                 if (ViewBag.Infor.SubcribeUsers != null)
                 {
                     <p>Phone number: @ViewBag.Infor.SubcribeUsers</p>
                 }
            }

            <p>Member from: @ViewBag.Infor.CreateTime</p>
            <p>Last visit: @ViewBag.Infor.LastVisit</p>
            <p></p>
            @*The questions and answers*@
        </fieldset>
    </div>
    }
    else
    {
        <div>@ViewBag.Message</div>
    }
    //Link to send message if Session != null
}
